/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.UserManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class ChangeUserMaxCompanyNum extends AbstractAction
/*    */ {
/*    */   public ChangeUserMaxCompanyNum(AbstractHttpServlet servlet)
/*    */   {
/* 22 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 28 */     response.setContentType("text/html;charset=utf-8");
/* 29 */     PrintWriter out = response.getWriter();
/* 30 */     JSONObject jsonObject = new JSONObject();
/*    */ 
/* 33 */     if (!super.getLoginUser(request).isAdmin) {
/* 34 */       jsonObject.put("error", "1");
/* 35 */       out.println(jsonObject);
/* 36 */       out.flush();
/* 37 */       out.close();
/* 38 */       return;
/*    */     }
/*    */ 
/* 41 */     String userIds = Util.getURLParameter(request.getParameter("userIds"));
/* 42 */     String maxCompanyNum = Util.getURLParameter(request
/* 43 */       .getParameter("maxCompanyNum"));
/*    */ 
/* 45 */     if ((maxCompanyNum == null) || (maxCompanyNum.length() == 0)) {
/* 46 */       maxCompanyNum = "0";
/*    */     }
/*    */ 
/* 49 */     UserManager manager = new UserManager();
/* 50 */     manager.updateUsersExtInfo(userIds, 2, 
/* 51 */       maxCompanyNum);
/* 52 */     jsonObject.put("error", "0");
/* 53 */     out.println(jsonObject);
/* 54 */     out.flush();
/* 55 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ChangeUserMaxCompanyNum
 * JD-Core Version:    0.6.1
 */